package com.fs.controller;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by fengshuai on 17/5/18.
 */
@Controller
//@RequestMapping("/index")
public class HelloWorld {
    protected static Logger logger = Logger.getLogger(HelloWorld.class);

    @RequestMapping("/index")
    @ResponseBody
    public String index() {
        return "Hello World";
    }

    @RequestMapping("/json")
    @ResponseBody
    public ModelMap json() {
        ModelMap modelMap = new ModelMap();
        return modelMap.addAttribute("success", true).addAttribute("message", "OK");
    }
}
